import random
from datetime import date, datetime as dt
from os import system
try:
    import pyperclip
except:
    from os import system
    print("缺少依赖pyperclip，安装中...")
    system("pip install pyperclip")
    import pyperclip


rand=lambda x:random.random()
date_today=dt.strftime(date.today(),"%m/%d")
def rand_sort(date:str=date_today):
    lst=input("输入想做的事情们，以/分隔: ").split("/")
    lst.sort(key=rand)
    print("\n以下是{date}的日程计划顺序: \n")
    clip_str=f'{date}\n\n'
    for i,elem in enumerate(lst,start=1):
        cur=f'{i}. {elem}'
        print(cur)
        clip_str+=(cur+'\n')
    pyperclip.copy(clip_str)
    print("\n已拷贝至剪贴板\n")
    system("pause")
    

if __name__=='__main__':
    date_sch=input("请输入计划日期，不输入默认为今天: ")
    if date_sch==None:
        date_sch=date_today
    rand_sort(date_sch)


